package com.acwing.partition18;

import java.io.*;
import java.util.Arrays;

/**
 * @author `RKC`
 * @date 2022/2/6 20:44
 */
public class AC1738蹄球 {

    private static final int N = 110, INF = 0x3f3f3f3f;
    private static int[] nums = new int[N], p = new int[N], inDegree = new int[N];
    private static int n = 0;

    private static final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    private static final BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) throws IOException {
        n = Integer.parseInt(reader.readLine());
        String[] ss = reader.readLine().split(" ");
        for (int i = 1; i <= n; i++) nums[i] = Integer.parseInt(ss[i - 1]);
        nums[0] = -INF;
        nums[n + 1] = INF;
        Arrays.sort(nums, 1, n + 1);
        for (int i = 1; i <= n; i++) {
            if (nums[i] - nums[i - 1] <= nums[i + 1] - nums[i]) {
                //会向左走
                p[i] = i - 1;
                inDegree[i - 1]++;
            } else {
                //会向右走
                p[i] = i + 1;
                inDegree[i + 1]++;
            }
        }
        //入度为0的贡献为1，只有两个节点的环且没有挂树的贡献为1/2
        int ans = 0;
        for (int i = 1; i <= n; i++) {
            if (inDegree[i] == 0) ans += 2;
            else if (p[p[i]] == i && inDegree[i] == 1 && inDegree[p[i]] == 1) ans++;
        }
        writer.write((ans / 2) + "\n");
        writer.flush();
    }
}
